<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>智能门禁管理</title>
    <link href="css/common.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!--<link href="css/font-awesome.min.css" rel="stylesheet">-->
    <link href="css/control.css" rel="stylesheet">
    <link href="css/access_control.css" rel="stylesheet">
    <link rel="stylesheet" href="css/font-awesome.css">
    <link rel="stylesheet" href="css/font-awesome-ie7.min.css">
</head>
<body style="cursor: pointer">
<div class="refer_box ">
    <div class="clearfix">
        <div class="lf refer_box_title">
            <span>*</span>PID初始值:
        </div>
        <div class="lf refer_box_input">
            <input class="pid" type="text" placeholder="PID编号">
        </div>
    </div>
    <div class="clearfix">
        <div class="lf refer_box_title">
            <span>*</span>PID结束值:
        </div>
        <div class="lf refer_box_input">
            <input class="pid_1" type="text" placeholder="PID编号">
        </div>
    </div>
    <div class="clearfix" style="position: relative">
        <div class="lf refer_box_title">
            公司名称:
        </div>
        <div class="lf refer_box_input company-head-box" style="position: relative">
            <input class="pid_2" type="text" readonly="readonly" placeholder="请选择公司">
            <i class="fa fa-angle-down"></i>
        </div>
        <ul class="refer_box_input_box  company_data">

        </ul>
    </div>
</div>
</body>
<script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>
<script src="js/layer.js"></script>
<script src="js/common.js" type="text/javascript"></script>
<script src="js/ajax_data.js" type="text/javascript"></script>
<script src="js/access.js" type="text/javascript"></script>
<script src="js/access_control.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script>
    /*选择公司下拉列表*/
    $('.company-head-box').on('click',function () {
        filtrate_list();
    });
    function filtrate_list(agtName) {
        $.ajax({
            url:global_url+'admin/tagent/selectList.json',
            dataType:'json',
            xhrFields:{withCredentials:true,useDefaultXhrHerder:false},
            type:'GET',
            async:false,
            data:{agtName:agtName},
            success:function (data) {
                var status=data.code;
                if(status==1){
                    var leng=data.data.length;
                    var htm_='';
                    for(var i=0;i<leng;i++){
                        var uName =data.data[i].agtName;
                        var sId =data.data[i].sId;
                        htm_+='<li data-sId='+sId+' data-uname='+uName+'>'+uName+'</li>';
                    }
                    /*$('.select_company').append(htm_);*/
                    $('.company_data').append(htm_);

                }else {
                    layer.msg('数据加载失败', {icon: 5});
                }
            }

        });
    }
    $(document).on('click','.select_company li',function () {
        var uName =$(this).attr('data-uname');
        var sId =$(this).attr('data-sId');
        $(".company-head").attr('data-comapy',uName);
        $(".company-head").attr('data-sId',sId);

    });
</script>
</html>